@using Microsoft.AspNetCore.Localization
@{
  var requestCulture = Context.Features.Get<IRequestCultureFeature>();
}
  <div class="layui-row layui-col-space15" id="frontpage">
    <div class="layui-col-md8">
      <div class="layui-row layui-col-space15">
        <div class="layui-col-md6">
          <div class="layui-card">
            <div class="layui-card-header">WTM -- build best .netcore open source framework</div>
            <div class="layui-card-body">

              <div class="layui-carousel layadmin-carousel " data-autoplay="true" data-anim="fade">
                <div carousel-item>
                  <div>
                    Walkingtec.mvvm framework (WTM for short) was first developed in 2013 ,based on asp.net mvc3 and the earliest Entity Framework. It was mainly used to solve problems of low coding efficiency and inconsistent code style. Based on dozens of projects,the framework has been gradually improved and four major versions have been launched during 4 years.
                  </div>
                  <div>
                    In September 2017, we migrated the code to .net core and greatly  optimized and refactored MVVC. We released new framework written on asp.net core and EF core. .Net core version has made great progress in architecture, stability and speed. It has really becomed a powerful tool for efficient web development.
                  </div>
                  <div>
                    We are happy that we provide mature open-source framework now. Please feel free to send us a note. let us know how we are doing and what you need.Thanks! <a href="https://github.com/WalkingTec/WalkingTec.Mvvm"
                                                                                                                                                                         target="_blank">https://github.com/WalkingTec/WalkingTec.Mvvm</a>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="layui-col-md6">
          <div class="layui-card">
            <div class="layui-card-header">WTM open source framework</div>
            <div class="layui-card-body">

              <div class="layui-carousel layadmin-carousel layadmin-backlog">
                <div carousel-item>
                  <ul class="layui-row layui-col-space10">
                    <li class="layui-col-xs6">
                      <a href="https://github.com/dotnetcore/WTM/stargazers" class="layadmin-backlog-body"
                         target="_blank">
                        <h3>Star</h3>
                        <p><cite id="githubstar"></cite></p>
                      </a>
                    </li>
                    <li class="layui-col-xs6">
                      <a href="https://github.com/dotnetcore/WTM/network/members" class="layadmin-backlog-body"
                         target="_blank">
                        <h3>Fork</h3>
                        <p><cite id="githubfork"></cite></p>
                      </a>
                    </li>
                    <li class="layui-col-xs6">
                      <a href="https://github.com/dotnetcore/WTM/watchers" class="layadmin-backlog-body"
                         target="_blank">
                        <h3>Watch</h3>
                        <p><cite id="githubwatch"></cite></p>
                      </a>
                    </li>
                    <li class="layui-col-xs6">
                      <a href="https://github.com/dotnetcore/WTM/issues" class="layadmin-backlog-body" target="_blank">
                        <h3>Issue</h3>
                        <p><cite id="githubissue"></cite></p>
                      </a>
                    </li>
                  </ul>
                  <ul class="layui-row layui-col-space10">
                    <li class="layui-col-xs12">
                      <span style="font-size:16px;line-height:50px;">WTM is a free open source framework. If you like it, come to GitHub and ‘STAR’ me!~~</span>

                      <p style="text-align:center">
                        <a href="https://github.com/dotnetcore/wtm" target="_blank"
                           style="background-color:#eee;background-image:linear-gradient(to bottom, #fcfcfc 0, #eee 100%);background-repeat:no-repeat;border:1px solid #d5d5d5;color:#333;padding:3px 10px 3px 8px;font-size:16px;line-height:22px">
                          <span width="20"
                                style="width:20px;height:20px;font-size:16px;line-height:22px;box-sizing:border-box; background-size:100% 100%; background-image:url('')">&nbsp;&nbsp;&nbsp;&nbsp;</span>
                          <span>Stars <cite id="githubstars"></cite></span>
                        </a>
                      </p>
                    </li>
                  </ul>
                </div>
              </div>
            </div>
          </div>
        </div>

        <div class="layui-col-md12">
          <div class="layui-card">
            <div class="layui-card-header">What WTM solving and how WTM works:</div>
            <div class="layui-card-body layadmin-takerates">
              WTM framework greatly improves development efficiency by structures conventional coding and automates repetitive coding.<br />
              In non-separated mode, it connects front-end UI with back-end code. You don't need to separate the front end and back end platform. You don't need two people to cooperate. WTM helps you to reduce the cost and shorten the R&D period.<br />
              In the mode of front-end and back-end separation, both front-end and back-end code can also be generated at the same time by the code generators. It greatly reduce the communication cost of front-end and back-end personnel. In this way , ‘separation’ is no longer complex and expensive.
            </div>
          </div>
        </div>
        <div class="layui-col-md12">
          <div class="layui-card">
            <div class="layui-card-header">Donor Wall</div>
            <div class="layui-card-body layadmin-takerates">
              <table id="WTM-donate" lay-filter="WTM-donate"></table>
            </div>
          </div>
        </div>
        Links:<a href="https://www.layui.com/" target="_blank">LayUI</a> <a href="http://www.hzhcontrols.com" target="_blank">HZHControls</a>
      </div>
    </div>

    <div class="layui-col-md4">

      <div class="layui-card">
        <div class="layui-card-header">Experience the beauty of WTM， NOW！</div>
        <div class="layui-card-body layadmin-takerates">
          <h2 style="text-align:center;margin-top:20px">
            <a href="/setup" target="_blank" style="color:#009688">Click here</a> ,  start your first WTM project<br /><br />
          </h2>
          <h3 style="text-align:center;margin-top:0px">
            <a href="https://community.walkingtec.cn/" target="_blank" style="color:#009688">
              Any questions? Come to WTM community!
            </a>
          </h3>

        </div>
      </div>


      <div class="layui-card">
        <div class="layui-card-header">Framework features</div>
        <div class="layui-card-body layadmin-takerates">
          <ul>
            <li><i class="layui-icon layui-icon-ok"></i>One click to generate WTM project </li>
            <li><i class="layui-icon layui-icon-ok"></i>One click to generate add, delete, modify and query database operations</li>
            <li><i class="layui-icon layui-icon-ok"></i>Support identification and code generation of one-to-many and many-to-many association models</li>
            <li><i class="layui-icon layui-icon-ok"></i>support front-back end separation mode (React+AntD,Vue+Element) and non-separation mode(LayUI)</li>
            <li><i class="layui-icon layui-icon-ok"></i>Support 3 databases: sqlserver, MySQL and PgSQL</li>
            <li><i class="layui-icon layui-icon-ok"></i>Encapsulates most of the controls of layUI, antd and element</li>
            <li><i class="layui-icon layui-icon-ok"></i>A lot of base classes are provided ,encapsulate most common background operations</li>
            <li><i class="layui-icon layui-icon-ok"></i>Provides common modules such as users, roles, user groups, menus, logs, etc</li>
            <li><i class="layui-icon layui-icon-ok"></i>Support the development and configuration of data authority</li>
            <li><i class="layui-icon layui-icon-ok"></i>Support read/ write splitting ;Support database sub Library</li>
          </ul>
        </div>
      </div>

      <div class="layui-card">
        <div class="layui-card-header">
          Author's words
          <i class="layui-icon layui-icon-tips" lay-tips="to pursue goodness is as difficult as ascending a mountain" lay-offset="5"></i>
        </div>
        <div class="layui-card-body layui-text layadmin-text">
          <p>
            WTM framework, full name walkingtec MVVM. Walkingtec is my own company.
            WTM is a rapid development framework.How fast ? At least at present, in the open source project of DotNetcore, I haven't seen another faster one. Our goal of WTM is to speed up the development and reduce cost to the greatest extent.
          </p>
          <p>
            WTM has been loved by more and more developers since its open source. WTM will surely repay your love with a more mature and stable version.Specially thanks to（<a href="http://www.layui.com/"
                                                                                                                                                                               target="_blank">layui.com</a> Improve yourself, benefit others, we am not alone!
          </p>
          <p>
            —— Open source address of framework：<a href="https://github.com/dotnetcore/WTM" target="_blank">https://github.com/dotnetcore/WTM</a>
          </p>
          <p>——Framework online document: <a href="https://wtmdoc.walkingtec.cn" target="_blank">https://wtmdoc.walkingtec.cn</a></p>
          <p>
            —— Framework update log:<a href="https://github.com/dotnetcore/WTM/blob/develop/CHANGELOG.md" target="_blank"> View update log</a>
          </p>
          <p>—— Frame QQ communication group:694148336</p>
        </div>
      </div>

      <div class="layui-card">
        <div class="layui-card-header">Connect you and me</div>
          <div class="layui-card-body" style="height:250px;">

            <div class="layui-carousel layadmin-carousel " data-autoplay="true" data-anim="fade">
              <div carousel-item style="height:250px;">
                @*<div style="height:400px;text-align:center">
                  <img src="~/imgs/gongzhonghao.jpg" width="300" height="300" style="border:solid 1px #d5d5d5" /><br />
                  <p>关注WTM微信公众号，及时了解框架更新</p>
                  <p>公众号还会定期发布视频教程</p>
                </div>*@
                <div style="text-align:center;">
                  <a href="https://paypal.me/dotnetWTM" target="_blank"  ><img src="~/imgs/pp_h_rgb.webp" width="300" style="margin-top:50px;"  /><br /></a>
                  If WTM helps you ...<br />
                </div>
              </div>
            </div>
          </div>
        </div>

    </div>

  </div>

  <script>
  $("#frontpage").parent().css("background-color", "#eee");
   $("#frontpage").parent().css("overflow", "scroll");

  $.get("/Home/GetGithubInfo", function (r) {
    $("#githubstar").html(r.stargazers_count);
    $("#githubstars").html(r.stargazers_count);
    $("#githubfork").html(r.forks_count);
    $("#githubwatch").html(r.subscribers_count);
    $("#githubissue").html(r.open_issues_count);
  });

  //区块轮播切换
  layui.use(['admin', 'carousel', 'table'], function () {
    var $ = layui.$
      , admin = layui.admin
      , table = layui.table
      , carousel = layui.carousel
      , element = layui.element
      , device = layui.device();

    //轮播切换
    $('.layadmin-carousel').each(function () {
      var othis = $(this);
      carousel.render({
        elem: this
        , width: '100%'
        , arrow: 'none'
        , interval: othis.data('interval')
        , autoplay: othis.data('autoplay') === true
        , trigger: (device.ios || device.android) ? 'click' : 'hover'
        , anim: othis.data('anim')
      });
    });

    element.render('progress');

    var compareFunc = function (p){ //这是比较函数
        return function(m,n){
            var a = m[p.field];
            var b = n[p.field];
            if(p.type==='desc'){
              return a > b?-1:1; // 降序
            }
            else{
              return a > b?1:-1; //升序
            }
        }
    }
    const tableIns = table.render({
      elem: '#WTM-donate'
      , id: 'WTM-donate'
      , url: '/json/donate.js'
      , page: true
      , autoSort: true
      , totalRow: true
      , cols: [[
        { type: 'numbers', fixed: 'left' }
        , { field: 'date', title: '@(requestCulture.RequestCulture.UICulture.Name == "zh"?"日期":"Date")', width: 120, sort: true }
        , { field: 'name', title: '@(requestCulture.RequestCulture.UICulture.Name == "zh"?"姓名":"Name")', width: 150, sort: true }
        , { field: 'amount', title: '@(requestCulture.RequestCulture.UICulture.Name == "zh"?"金额":"Amount")', width: 120, totalRow: true, sort: true, templet:'<div><i class="_wtmicon _wtmicon-renminbi">{{ d.amount }}</i></div>' }
        , { field: 'from', title: '@(requestCulture.RequestCulture.UICulture.Name == "zh"?"来源":"From")', width: 80 }
        , { field: 'comment', title: '@(requestCulture.RequestCulture.UICulture.Name == "zh"?"留言":"Message")' }
      ]]
      , parseData: function(res){
        var list = res.Data;
        if(this.initSort){
          list = list.sort(compareFunc(this.initSort))
        }
        var pageIndex = this.page.curr===undefined?1:this.page.curr;
        var result = list.slice(this.limit*(pageIndex-1),this.limit*pageIndex);
        return {
                "Code": 200,
                "Msg":"",
                "Count": res.Data.length,
                "Data": result
              }
      }
      , skin: 'line'
      , height: 840
      ,initSort: {
        field: 'date'
        ,type: 'desc'
      }
    });
    table.on('sort(WTM-donate)', function(obj){
      table.reload('WTM-donate',{initSort: obj});
    });
  });

  </script>
